#ifndef VIDEO_PTZ_CTRL_H
#define VIDEO_PTZ_CTRL_H

// VideoCtrl Cmd
#define SET_SUB_VIDEO	0
#define SET_MAIN_VIDEO	1
#define GET_SUB_VIDEO	2
#define GET_MAIN_VIDEO	3

//add zm 20100105{ imagepara
#define SET_SUB_IMAGE	4
#define GET_SUB_IMAGE	5
//add zm 20100105}imagepara
// lwj modify 091202
#if 1
// PTZCtrl Cmd
#define SET_PTZ_PARAM 4
#define GET_PTZ_PARAM	5
#define CTRL_PTZ_UP 6
#define CTRL_PTZ_DOWN 7
#define CTRL_PTZ_LEFT 8
#define CTRL_PTZ_RIGHT 9
#define CTRL_PTZ_ZOOM_IN 10
#define CTRL_PTZ_ZOOM_OUT 11
#define CTRL_PTZ_FOCUS_UP 12
#define CTRL_PTZ_FOCUS_DOWN 13
#define CTRL_PTZ_IRIS_IN 14
#define CTRL_PTZ_IRIS_OUT 15

// VideoCtrl Cmd(new add)
#define SET_MINQP_VIDEO 100
#define GET_MINQP_VIDEO 101

#else
// lwj add 091023
#define SET_MINQP_VIDEO 4
#define GET_MINQP_VIDEO 5
// lwj add end

// PTZCtrl Cmd
#define SET_PTZ_PARAM 100
#define GET_PTZ_PARAM	101
#define CTRL_PTZ_UP 102
#define CTRL_PTZ_DOWN 103
#define CTRL_PTZ_LEFT 104
#define CTRL_PTZ_RIGHT 105
#define CTRL_PTZ_ZOOM_IN 106
#define CTRL_PTZ_ZOOM_OUT 107
#define CTRL_PTZ_FOCUS_UP 108
#define CTRL_PTZ_FOCUS_DOWN 109
#define CTRL_PTZ_IRIS_IN 110
#define CTRL_PTZ_IRIS_OUT 111
#endif
// lwj modify end

// VideoCtrl Param ID
#define VENC_PARAM	0

// PTZCtrl Param ID
#define YUNTAI_PARAM 1
//add zm 20100105{ imagepara
#define IMAGE_PARAM 2
//add zm 20100105}imagepara

#pragma pack(push, 1)

typedef struct
{
	int len;	// must be sizeof(venc_param)
	unsigned int ID;	// must be VENC_PARAM
	unsigned char	is_cif;	//0:QCIF;1:CIF
	unsigned int frame_rate; // be one of {25,20,10,5,2,1}
	unsigned int bitrate; // be one of {1024, 768, 512, 384, 256, 128, 64}(K)
	unsigned char	is_cbr;	// 0:vbr;1:cbr
	unsigned int	pic_level;	// 0~5	0:best....5:worst
// lwj add 091023
	unsigned int minQP;
	//add zm 20100105{imagepara
	unsigned short hue;
	unsigned short saturation;
	unsigned short contrast;
	unsigned short brightness;
	//add zm 20100105}imagepara
// lwj add end
}venc_param;

typedef struct	//for SET_PTZ_PARAM
{
	int len;	// must be sizeof(yuntai_param)
	unsigned int ID;	// must be YUNTAI_PARAM
	unsigned short  address;	//decoder addr
	unsigned int  baud_rate;// be one of { 115200, 57600, 38400, 19200, 9600, 4800, 2400, 1200, 300 }
	unsigned char   data_bit;	// 8 or 7
	unsigned char   stop_bit;	// 1 or 2
	unsigned char   crccheck;	// 0:no check; 1:odd check; 2:even check
	unsigned char   flow_control; // 0:no; 1:hardware; 2: xon/xoff
	unsigned char   protocol;	// 0:pelco-d; 1:pelco-p; 2:b01; 3:samsung
}yuntai_param;
#pragma pack(pop)

int VideoCtrl(unsigned char channel_idx, unsigned int cmd, void *param);
int PTZCtrl(unsigned char channel_idx, unsigned int cmd, void *param);


#endif
